// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 巡检任务情页 GET /api/patroljob/${param0} */
export async function getPatrolJobInfo(
  params: {
    // path
    /** 任务id */
    id: number;
  },
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.PatrolJob>(`/api/patroljob/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取巡检任务 GET /api/patroljob */
export async function queryPatrolJob(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/patroljob', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取巡检任务 GET /api/patroljob */
export async function patrolJobList(
  options?: { [key: string]: any },
) {
  return request<API.PatrolJob[]>('/api/patroljob', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 更新巡检任务 PUT /api/patroljob */
export async function updatePatrolJob(body: API.PatrolJob, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/patroljob', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加巡检任务 POST /api/patroljob */
export async function addPatrolJob(body: API.PatrolJob, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/patroljob', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除巡检任务 DELETE /api/patroljob */
export async function removePatrolJob(
  params: {
    // query
    /** 对象主键 */
    id?: number;
  },
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/patroljob', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取巡检项目 GET /patroljob/item */
export async function queryPatrolJobItem(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
    /** 任务id */
    id?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/patroljob/item', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新巡检项目 PUT /patroljob/item */
export async function updatePatrolJobItem(
  body: API.PatrolJobItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/patroljob/item', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加巡检项目 POST /patroljob/item */
export async function addPatrolJobItem(body: API.PatrolJobItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/patroljob/item', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除巡检项目 DELETE /patroljob/item */
export async function removePatrolJobItem(
  params: {
    // query
    /** 对象主键 */
    id?: number;
  },
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/patroljob/item', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}